package com.zbkj.crmeb.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 品牌类型
 * @Description: 
 * @author daigb
 * @date 2021-04-13
 */
public enum BrandTypeEnum implements IEnum<Integer> {
    /**
     * 寻物
     */
    XUNWU(1, "寻物"),
    
    /**
     * 欧洲
     */
    EUROPE(2, " 欧洲"),
    
    /**
     * buyer商品
     */
    BUYER(3, "buyer"),
    
    /**
     * 其他
     */
    OTHER(4, "其他")
    ;

    private final Integer code;
    private final String msg;

    BrandTypeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    @JsonCreator
    public static BrandTypeEnum valueOf(Integer code) {
        for (BrandTypeEnum value : values()) {
            if (code.equals(value.getCode())) {
                return value;
            }
        }
        return BrandTypeEnum.OTHER;
    }

    @Override
    @JsonValue
    public Integer getValue() {
        return code;
    }

}

